package org.dmcs.linguistics.labs.nfa.parser;

import org.dmcs.linguistics.labs.nfa.input.symbols.ISymbolTranslator;
import org.dmcs.linguistics.labs.nfa.input.symbols.NFAInputSymbol;

/**
 * A tool for parsing 
 * @author Zielony
 * @version 1.0
 */
public class CharacterToSymbolTranslator implements ISymbolTranslator<Character, NFAInputSymbol> {
	/**
	 * {@inheritDoc}
	 */
	public NFAInputSymbol translate(Character c) {
		switch(c) {
			case '0':
				return NFAInputSymbol.ZERO;
			case '1':
				return NFAInputSymbol.ONE;
			case '2':
				return NFAInputSymbol.TWO;
			case '3':
				return NFAInputSymbol.THREE;
			case '4':
				return NFAInputSymbol.FOUR;
			case '5':
				return NFAInputSymbol.FIVE;
			case '6':
				return NFAInputSymbol.SIX;
			case '7':
				return NFAInputSymbol.SEVEN;
			case '8':
				return NFAInputSymbol.EIGHT;
			case '9':
				return NFAInputSymbol.NINE;
			default:
				return null;
		}
	}
}